﻿<UserControl x:Class="StreamInsight.Samples.SequenceIntegration.ObservableDataGridControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <DataGrid Name="_grid" 
                  x:FieldModifier="private"
                  AutoGenerateColumns="False"
                  ItemsSource="{Binding}"
                  CanUserSortColumns="False"
                  AlternatingRowBackground="LightGray">
        </DataGrid>
        <TextBlock Name="_errorTextBox" 
                   x:FieldModifier="private"
                   Grid.Row="1"
                   Margin="5,3"
                   MaxHeight="100"
                   FontWeight="Bold"
                   Foreground="Red" 
                   TextWrapping="Wrap"
                   ToolTip="{Binding Source=_errorTextBox, Path=Text}">
        </TextBlock>
        <StackPanel Grid.Row="2" 
                    HorizontalAlignment="Right" 
                    Orientation="Horizontal">
            <CheckBox Name="_lockScrollBarCheckBox"
                      Margin="5, 3"
                      Content="Lock"/>
            <Button Name="_playButton" 
                    x:FieldModifier="private" 
                    Content="Play" 
                    Width="100" 
                    IsEnabled="false"
                    Click="PlayClick" />
            <Button Name="_stopButton" 
                    x:FieldModifier="private"
                    Content="Stop" 
                    Margin="10, 0, 0, 0" 
                    Width="100" 
                    IsEnabled="false"
                    Click="StopClick" />
        </StackPanel>
    </Grid>
</UserControl>
